def chat_command(ch,args):
  """
  Usage:
  chat [message]
  
  Broadcasts a message to the mud.
  """
  message = ""
  if args:
    message = " ".join(args)
  if args and len(message) > 0:
    message = "${cyan,bold}%s chats '%s${cyan,bold}'" % (ch.name, message)
    ch.toWorld(message)
  else:
    ch.toSelf("Chat what?")
    
def whisper_command(ch, args):
  """
  Usage:
  whisper <player> [message]
  
  Sends a private message to a player.
  """
  try:
    vict = ch.getPlayerInWorld(args[0])
  except:
    ch.toSelf("Whisper to whom?")
    return
  
  try:  
    message = args[1:]
  except:
    ch.toSelf("Whisper what to %s" % (player) )
    
  if vict is None:
    ch.toSelf("Can't find %s" % args[0])
    return
      
  if vict != ch:
      ch.toSelf("${magenta,bold}You whisper to %s, '%s'" % (vict.name, " ".join(message)) )
      vict.toSelf("${magenta,bold}%s whispers to you, '%s'" % (ch.name, " ".join(message) ) )
  else:
    ch.toSelf("It's ok if you talk to yourself. I won't tell anyone.")

